#include "hplcqinfinedetectorsendsystempacket.h"
#include "hplcqinfinedetectorprotocoldata.h"
#include "common/hplcqinfinecheckpacket.h"
#include "common/hplcqinfinemakepacket.h"
#include "common/hplcqinfinepfcid.h"

namespace hplc
{
namespace qinfine
{

HplcQinfineDetectorSendSystemPacket::HplcQinfineDetectorSendSystemPacket(HplcQinfineDetectorProtocolData &data)
{
    m_d = &data;
}

void HplcQinfineDetectorSendSystemPacket::setCoil(quint8 flag)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_COIL, flag);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getCoil()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_COIL);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setTimeIntegral(quint16 timeInte)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_TIME_INTEGRAL, timeInte);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getTimeIntegral()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_TIME_INTEGRAL);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setRangeIntegral(quint8 rangeInteIndex)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_RANGE_INTEGRAL, rangeInteIndex);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getRangeIntegral()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_RANGE_INTEGRAL);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setAuFactor(float factor)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_AU_FACTOR, factor);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getAuFactor()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_AU_FACTOR);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setRasterStep(quint8 dir, quint32 step)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_RASTER_STEP, dir, step);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setHomeOffset(qint32 offset)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_HOME_OFFSET, offset);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getHomeOffset()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_HOME_OFFSET);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setWaveOffset(quint32 offset)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_WAVE_OFFSET, offset);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getWaveOffset()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_WAVE_OFFSET);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setWorkMode(quint8 mode, quint8 flag)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_WORKMODE, mode, flag);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getWorkMode()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_WORKMODE);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setWaveCalibDataCMD(quint8 cmd)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_WAVECALIB_DATA_CMD, cmd);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setWaveCalibData(float wave, float realWave)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_WAVECALIB_DATA, wave, realWave);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getWaveCalibData()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_WAVECALIB_DATA);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setLampUsedTime(quint32 time)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_LAMP_USED_TIME, time);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getLampUsedTime()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_LAMP_USED_TIME);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setLampOnOffTimes(quint16 times)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_LAMP_ONOFF_TIMES, times);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getLampOnOffTimes()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_LAMP_ONOFF_TIMES);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setLampCount(quint8 count)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_LAMP_COUNT, count);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getLampCount()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_LAMP_COUNT);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setDACZeroVoltage(float voltage)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_DAC_ZEROVOLTAGE, voltage);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getDACZeroVoltage()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_DAC_ZEROVOLTAGE);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setUploadObject(quint8 object)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_UPLOADOBJECT, object);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getUploadObject()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_UPLOADOBJECT);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setHomeTimeIntegral(quint16 timeInte)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_HOME_TIME_INTEGRAL, timeInte);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getHomeTimeIntegral()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_HOME_TIME_INTEGRAL);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setHomeRangeIntegral(quint8 rangeInteIndex)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_HOME_RANGE_INTEGRAL, rangeInteIndex);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::getHomeRangeIntegral()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_EXT_SYSTEM), (quint8)PFC_DES_HOME_RANGE_INTEGRAL);
    m_d->m_checker->sendRetry();
}

void HplcQinfineDetectorSendSystemPacket::setRefMin(quint32 min)
{

}

void HplcQinfineDetectorSendSystemPacket::getRefMin()
{

}

void HplcQinfineDetectorSendSystemPacket::setSamMin(quint32 min)
{

}

void HplcQinfineDetectorSendSystemPacket::getSamMin()
{

}

} // qinfine
} // hplc
